//  左侧全局控制显示组件是否显示
const state = {
  // 左侧导航菜单组件
  sidebar: {
    id: 'SET_SIDEBAR',
    isShow: false,
    components: 'Steps', // 组件类型
    Observer: {
      refresh: () => {
        console.warn('Test Refresh !');
      }
    } // 组件调用数据方法
  }
};

const mutations = {
  SET_SIDEBAR: (state, device) => {
    state.device = device;
  }
};

const actions = {
  changeComponents({ commit }, comp) {
    commit(comp.id || 'SET_SIDEBAR', comp);
  }
};

export default {
  namespaced: true,
  state,
  mutations,
  actions
};
